<h1>Request a Leave</h1>
<? if(! empty($errors)): ?>
<ul class="errors">
    <li><?= implode('</li><li>', $errors) ?></li>
</ul>
<? endif ?>
<?= $this->Form->create('Leave', array('action' => 'save')) ?>
	<?= $this->Form->hidden('user_id', array( 'value' => $user['id'])) ?>
	
	<p><?= $this->Form->label('leave_type_id', 'Type:') ?>
	<?= $this->Form->select('leave_type_id', $leaveTypes, array(
		'empty' => false,
        'value' => @$data['Leave']['leave_type_id']
	)) ?></p>
	
	<p><?= $this->Form->label('start', 'From:') ?>
	<?= $this->App->datepicker('start', @$data['Leave']['start']) ?>
	<?= $this->Form->label('end', 'To:') ?>
	<?= $this->App->datepicker('end', @$data['Leave']['end']) ?></p>
	
	<p><?= $this->Form->label('note', 'Note:') ?><br>
	<?= $this->Form->textarea('note', array(
		'maxlength' => 255,
        'value'     => @$data['Leave']['note']
	)) ?></p>

	<?= $this->Form->submit('Save') ?>
<?= $this->Form->end() ?>
